<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" 
	template="/templates/layout.xhtml">
		
	<ui:define name="head"></ui:define>

	<ui:define name="ptitle">出库单查询</ui:define>
	
	<ui:define name="pcontent">	    
	<h:form id="frm6"> 
		<h:panelGrid columns="10" cellspacing="10">	
			<p:outputLabel value="出库单号" />
			<p:inputText  value="#{saleoutQueryMB.io.id}" />
			<p:outputLabel value="合同名称" />
			<p:inputText value="#{saleoutQueryMB.io.contName}" />
			<p:outputLabel value="出库日期" />
			<p:calendar id="stime" locale="zh" navigator="true" value="#{saleoutQueryMB.beginTime}" pattern="yyyy-MM-dd" />
			<h:outputText for="etime" value="------------" />
			<p:calendar id="etime"  locale="zh" navigator="true" value="#{saleoutQueryMB.endTime}" pattern="yyyy-MM-dd" />				
				
            <p:commandButton value="查询"	icon="ui-icon-search"  
				action="#{saleoutQueryMB.queryAction}"  update=":frm7 ">
			</p:commandButton>		
		</h:panelGrid>
	</h:form>

	<h:form id="frm7">
		<p:growl id="msgs1" showDetail="true" />
		<p:panel id="contPanel" header="出库单信息" style="margin-bottom:5px">
			
			<p:dataTable id="pdt" value="#{saleoutQueryMB.voc}"  var="prow"  rowIndexVar="prowNum"
				style="margin-bottom:5px"								
				paginator="true" paginatorPosition="bottom" rows="8"  emptyMessage="没有记录" 
				paginatorTemplate="{Exporters}  {CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} ">					

				<f:facet name="{Exporters}">
		            <h:commandLink title="导出XLS">
		                <p:graphicImage name="/images/xls.png" width="16" height="16"/>
		                <p:dataExporter type="xls" target="pdt" fileName="saleouts" />
		            </h:commandLink>		 
		        </f:facet>
				
				<p:column headerText="详情" style="width:32px" exportable="false">
					<p:commandButton icon="ui-icon-search"   title="详情"  
						action="bme_saleout_mgr.xhtml?faces-redirect=true" >
						<f:setPropertyActionListener value="#{prow.bmeSaleoutDetails}"
							target="#{saleoutMB.vod}" />						
						<f:setPropertyActionListener value="#{prow}"
							target="#{saleoutMB.io}" />		
						<f:setPropertyActionListener value="#{prow.bmeContract}"
							target="#{saleoutMB.selectedContract}" />	
							
						<f:setPropertyActionListener value="#{prow.bmeContract.bmeContProds}"
							target="#{saleoutMB.selectedContProds}" />
															
						<f:setPropertyActionListener value="#{prow.id}"
							target="#{saleoutMB.uploadForId}" />	
						<f:setPropertyActionListener value="#{prow.contName}"
							target="#{saleoutMB.uploadForName}" />																		
					</p:commandButton>	
				</p:column>		
				<p:column headerText="No."  width="20" exportable="false">
					#{prowNum+1}
				</p:column>
				
				<p:column headerText="出库单编号"  width="100" sortBy="#{prow.id}">
					<h:outputText value="#{prow.id}" />
				</p:column>
				<p:column headerText="出库日期" width="100" >
					<h:outputText value="#{prow.outDate}"  >
						<f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8"/>
					</h:outputText>					
				</p:column>
				<p:column headerText="合同名称" width="100" >
					<h:outputText value="#{prow.contName}" />
				</p:column>
				<p:column headerText="收货地址" width="100" >
					<h:outputText value="#{prow.address}" />
				</p:column>
				<p:column headerText="客户名称" width="100" >
					<h:outputText value="#{prow.bmeCustomer.name}" />
				</p:column>
				<p:column headerText="金额" width="100" >
					<h:outputText value="#{prow.amount}" />
				</p:column>				
				<p:column headerText="备注" width="100" >
					<h:outputText value="#{prow.remarks}" />
				</p:column>
			
			</p:dataTable>
							
		</p:panel>
						
	</h:form>
	</ui:define>
</ui:composition>
